<template>
	<view class="box">
		<view class="tou top fixed" :style="'padding-top:' + statusBarHeight1 + 'px'">
			<image @click="fanhui" class="image1" src="https://pic.bangbangtongcheng.com/static/fanhui_bai.png" />
			<!-- #ifndef MP-WEIXIN -->
			{{year1}}月会员好礼
			<!-- #endif -->
			<!-- #ifdef MP-WEIXIN -->
			<text @click="fanhui" style="margin-left:75rpx">{{year1}}月会员好礼</text>
			<!-- #endif -->
		</view>
		<view class="" style="height: 120rpx;" v-if="licensePlateList.length!=0">
			<view class="classify_top">
				<view class="left">
					车牌号
				</view>
				<view class="right">
					会员礼
				</view>
			</view>
		</view>
		<!-- 判断用户当前绑定车没有绑定了就显示左侧 -->
		<view class="classify" v-if="licensePlateList.length!=0">
			<scroll-view scroll-y="true" class="classify-left scroll-view">
				<view class="iteam" :style="{backgroundColor:cut==j?'#ffffff':''}" v-for="(i,j) in licensePlateList"
					:key="i.id" @click="cutClik(j)">
					{{i.licensePlateNumber}}
					<view class="nums" v-if="i.recordNum > 0 && cut != j && months == 1">
						+{{i.recordNum}}
					</view>
				</view>
			</scroll-view>
			<scroll-view scroll-y="true" class="classify-right scroll-view">
				<view class="productList">
					<block v-for="(item,index) in giftList" :key="index">
						<view class="new-title" v-if="item.navTitle" style="padding: 30rpx 0;position: relative;border-top: 2rpx solid #D8D8D8;">
							<text style="font-size: 28rpx;font-weight: 400;color: #333333;line-height: 40rpx;">{{item.navTitle}}</text>
							
							
							<!-- <view class=""  v-if="giftList.filter(item2=>item2.batch==item.batch&&item2.whetherReceive).length>0 || item.whetherAdvance>0 || item.whetherOverdue>0" style="position: absolute;top: 50%;right: 0;transform: translateY(-50%);width: 150rpx;height: 60rpx;background: #999999;border-radius: 30rpx 30rpx 30rpx 30rpx;opacity: 1;display: flex;align-items: center;justify-content: center;font-size: 26rpx;font-weight: 400;color: #FFFFFF;">
								{{giftList.filter(item2=>item2.batch==item.batch&&item2.whetherReceive).length>0?'已领取':(item.whetherAdvance>0?'未生效':'已过期')}}
							</view>
							<view class="" @click.stop="qulq(item,1)" v-else style="position: absolute;top: 50%;right: 0;transform: translateY(-50%);width: 150rpx;height: 60rpx;background: #64B6A8;border-radius: 30rpx 30rpx 30rpx 30rpx;opacity: 1;display: flex;align-items: center;justify-content: center;font-size: 26rpx;font-weight: 400;color: #FFFFFF;">
								<image src="https://pic.bangbangtongcheng.com/static/member/goMerchant.png" mode="widthFix"
									style="vertical-align: middle;width: 40rpx;"></image>去领取
							</view> -->
						</view>
						<view class="iteam" :key="item.id" style="margin-bottom: 20rpx;" v-else>
							<view class="iteam_top" @click="lpdetails(item)">
								<image class="iteam_image" :src="item.giftPicture" mode="aspectFill" style="width: 132rpx;height: 132rpx;"> </image>
								<view class="iteam_right" style="margin-left: 20rpx;">
									<view class="title" style="font-size: 30rpx;font-weight: 400;color: #333333;line-height: 42rpx;">{{item.giftName}}</view>
									<view class="fenshu">
										<view class="price" v-if="item.price && item.price != '0.00'">
											<view class="price1">￥{{item.price}}</view>
											<view class="price2">￥0</view>
										</view>
										<view class="price"  v-else></view>
										<view>
											
											<view class="fenshu_l" @click.stop
												v-if="item.whetherReceive>0 || item.whetherAdvance>0 || item.whetherOverdue>0 "
												style="background-color: #999999;">
												{{item.whetherReceive>0?'已领取': (item.whetherAdvance>0?'未生效':'已过期')}}
											</view>
											<view class="fenshu_l"
												:style="'background-color:'+(item.isDisabled || item.isCanRecord == 0?'#999999;':'#64B6A8;')" v-else
												@click.stop="qulq(item,1)">
												<image src="https://pic.bangbangtongcheng.com/static/member/goMerchant.png" mode="widthFix"
													style="vertical-align: middle;width: 40rpx;"></image>去领取
											</view>
											
											<view class="fenshu_s" style="font-size: 24rpx;font-weight: 400;">
												<template v-if="item.showNum">余：{{item.stock}}份</template>
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
						<!-- <view v-if="item.whetherReceive>0 || item.whetherAdvance>0 || item.whetherOverdue>0 ">

						</view> -->
						<view v-if="item.giftType == 1">
							<view class="date" v-if="item.collectionTime && item.giftType != 2 ">
								领取时间: {{dataShow(item.collectionTime)}}
							</view>
							<view class="date" v-if="item.giftType == 2">
								领取时间: {{item.receiveTime}}
							</view>
						</view>
					</block>
					
						<!-- <view class="iteam_top" @click="lpdetails(item)">
							<image class="iteam_image" :src="item.giftPicture" mode="aspectFill"></image>
							<view class="iteam_right">
								<view class="title">{{item.giftName}}</view>
								<view class="fenshu">
									<view class="fenshu_s">
										余：{{item.stock}}份
									</view>
									<view class="fenshu_l"
										v-if="item.whetherReceive>0 || item.whetherAdvance>0 || item.whetherOverdue>0"
										style="background-color: #C7C7C7;">
										{{item.whetherReceive>0?'已领取':(item.whetherAdvance>0?'未生效':'已过期')}}
									</view>
									<view class="fenshu_l"
										:style="'background-color:'+(mothChage?'#C7C7C7;':' #64B6A8;')" v-else
										@click.stop="qulq(item,1)">
										去领取
									</view>
								</view>
							</view>
						</view>
						<view class="iteam_time">领取时间:{{item.receiveStartTime+"至"+item.receiveEndTime}}</view> -->
						<!-- 新的部分 -->
					<view class="more" v-if="giftList.length > 1 && giftList.length != 0 && months != 2">
						— 更多好礼陆续上架中 —
					</view>
					<view v-if="giftList.length == 0" class="none">
						<image src="https://pic.bangbangtongcheng.com/static/none.png"
							mode="widthFix" />
						<view>{{downStatus?'加载中...':months==3?'更多好礼，敬请期待':'没有更多数据了'}} </view>
					</view>
				</view>
			</scroll-view>
		</view>
		<view class="classify" v-else>
			<scroll-view scroll-y="true" style="width: 100%;" class="classify-right scroll-views">
				<view class="productList">
					<block v-for="(item,index) in giftList" :key="index">
						<view class="new-title" v-if="item.navTitle" :key="index" style="padding: 30rpx 0;position: relative;border-top: 2rpx solid #D8D8D8;">
							<text style="font-size: 28rpx;font-weight: 400;color: #333333;line-height: 40rpx;">{{item.navTitle}}</text>
							
							<!-- <view class=""  v-if="item.whetherAdvance<=0 && item.whetherOverdue<=0" style="position: absolute;top: 50%;right: 0;transform: translateY(-50%);width: 150rpx;height: 60rpx;background: #64B6A8;border-radius: 30rpx 30rpx 30rpx 30rpx;opacity: 1;display: flex;align-items: center;justify-content: center;font-size: 26rpx;font-weight: 400;color: #FFFFFF;">
								<image src="https://pic.bangbangtongcheng.com/static/member/goMerchant.png" mode="widthFix"
									style="vertical-align: middle;width: 40rpx;"></image>去领取
							</view>
							<view class="" v-else style="position: absolute;top: 50%;right: 0;transform: translateY(-50%);width: 150rpx;height: 60rpx;background: #999999;border-radius: 30rpx 30rpx 30rpx 30rpx;opacity: 1;display: flex;align-items: center;justify-content: center;font-size: 26rpx;font-weight: 400;color: #FFFFFF;">
								{{item.whetherAdvance>0?"未生效":"已过期"}}
							</view> -->
						</view>
					<view class="iteam" v-else :key="item.id" style="margin-bottom: 30rpx;" >
						<view class="iteam_top" @click="lpdetails(item)">
							<image class="iteam_images" style="width: 132rpx;height: 132rpx;" :src="item.giftPicture" mode="aspectFill"></image>
							<view class="iteam_right">
								<view class="titles" style="font-size: 30rpx;font-weight: 400;color: #333333;line-height: 42rpx;">{{item.giftName}}</view>
								<view class="fenshu" style="font-size: 24rpx;font-weight: 400;">
									
									<view class="price" v-if="item.price && item.price != '0.00'">
										<view class="price1">￥{{item.price}}</view>
										<view class="price2">￥0</view>
									</view>
									<view class="price"  v-else></view>
									
									<view class="fenshu_l" :class="item.isCanRecord == 0?'fail':''" v-if="item.whetherAdvance<=0 && item.whetherOverdue<=0 " @click.stop="qulq(item,2)">
										<image src="https://pic.bangbangtongcheng.com/static/member/goMerchant.png" mode="widthFix"
											style="vertical-align: middle;width: 40rpx;"></image>去领取
									</view>
									<view @click.stop class="fenshu_l" style="background-color: #C7C7C7;"  :style="'background-color: #999999;'" v-else>
										{{item.whetherAdvance>0?"未生效":"已过期"}}
									</view>
									
								</view>
								<!-- <view class="iteam_time">领取时间:{{item.receiveStartTime+"/"+item.receiveEndTime}}</view> -->
								<view v-if="item.giftType == 1">
									<view class="iteam_time" v-if="item.collectionTime && item.giftType != 2 ">
										领取时间: {{dataShow(item.collectionTime)}}
									</view>
									<view class="iteam_time" v-if="item.giftType == 2">
										领取时间: {{item.receiveTime}}
									</view>
								</view>
							</view>
						</view>
					</view>
					</block>
					
					<view class="more" v-if="giftList.length > 1 && giftList.length != 0 && months != 2">
						— 更多好礼陆续上架中 —
					</view>
					<view v-if="giftList.length == 0" class="none">
						<image src="https://pic.bangbangtongcheng.com/static/none.png"
							mode="widthFix" />
						<view>{{downStatus?'加载中...':months==3?'更多好礼，敬请期待':'没有更多数据了'}} </view>
					</view>
				</view>
			</scroll-view>
			
		</view>
		<!-- 照片弹窗 -->
		<uni-popup ref="binds" mode="center">
			<view class="binds_frame">
				<template v-if="qiehuan==1">
					<view class="binds_frame_t">当前礼品已领完，请选择其它礼品</view>
					<view class="binds_frame_b" @click="tcGuanBi">
						确定
					</view>
				</template>
				<template v-else>
					<view class="binds_frame_t">前往门店绑定会员码，每月领取会员好礼哦~ </view>
					<view class="binds_frame_b" @click="toTranslate()">
						去绑定
					</view>
				</template>
			</view>
		</uni-popup>
		<uniBall></uniBall>
	</view>
</template>

<script>
	var count=100000;
	var numToSort={
		
	}
	import {
		mapGetters
	} from "vuex";
	let statusBarHeight;
	//#ifdef H5
	import wxshare from "../../utils/index.js";
	statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 10 + 44;
	//#endif
	// #ifdef APP-PLUS
	statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 10 + 44;
	//  #endif
	// #ifdef MP-WEIXIN
	statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 5 + 88;
	//  #endif
	export default {
		data() {
			return {
				statusBarHeight,
				imgUrl: this.$imgSrc,
				userInfo: uni.getStorageSync("Pduser"),
				// 车牌
				licensePlateList: [],
				cut: 0,
				giftList: [],
				qiehuan: 1,
				mothChage: false,
				months:0,
				downStatus: true,
				year1: '',
				evdate:''
			};
		},
		computed: {
			...mapGetters(["statusBarHeight1", "userinfo"])
		},
		async onLoad(options) {
			this.months = options.months
			console.log(this.months);
			this.year1 = options.month
			this.evdate = options.evdate
			await this.licensePlate()
			/* #ifdef H5 */
			this.jinzhi();
			/* #endif */
		},
		methods: {
			multipleForOneText(num){
				switch(num){
					case 1:
						return '一';
						break;
					case 2:
						return '二';
						break;
					case 3:
						return '三';
						break;
					case 4:
						return '四';
						break;
					case 5:
						return '五';
						break;
					case 6:
						return '六';
						break;
					case 7:
						return '七';
						break;
					case 8:
						return '八';
						break;
					case 9:
						return '九';
						break;
					case 10:
						return '十';
						break;
				}
			},
			// 获取车牌号列表
			async licensePlate() {
				await this.$myRequest.get("/api/mobile/vehicleOwner/getLicensePlateNumberListByUserId", {
					userId: this.userInfo.id,
					deleteFlag: 0
				}).then(res => {
					this.licensePlateList = res.LicensePlateNumberList.pageList
					this.gift(0)
				});
			},
			dataShow(date) {
				 let firstDate = new Date();
				let dates = new Date()
				let lastDay = new Date(this.evdate.split('-')[0],this.evdate.split('-')[1],0).getDate()
				if (!date) return
				if (date.split('-').length > 1) {
					let dateList = date.split('-')
					if (Number(dateList[1]) > lastDay) {
						return this.year1 + '月' + dateList[0] + "日-" + this.year1 + '月' + lastDay + "日"
					} else {
						return this.year1 + '月' + dateList[0] + "日-" + this.year1 + '月' + dateList[1] + "日"
					}
					
				} else if (date.split(',').length > 1){
					let dateList = date.split(',')
					let str = this.year1 + '月'
					dateList.forEach((el, index) => {
						if (el > lastDay) return
						if (index == dateList.length -1) 
						{
							str+= el+ '日'
						} else {
							str+= el+ '日，'
						}
					})
					if (str[str.length -1] == '，') {
						str = str.substring(0, str.length-1)
					}
					return str
				} else {
					let str = this.year1 + '月' + date + '日'
					return str
				}
			},
			// 获取礼品列表
			gift(index) {
				uni.showLoading({
					title: '加载中'
				});
				this.license = this.licensePlateList[index] ? this.licensePlateList[index]
						.licensePlateNumber : ""
				this.$myRequest.get("/api/mobile/vehicleOwner/getUnclaimedGiftInformation", {
					licensePlateNumber: this.licensePlateList[index] ? this.licensePlateList[index]
						.licensePlateNumber : "",
						
					months:	this.months||1,
					years:this.evdate
				}).then(res => {
					// let date=new Date()
					// let time = date.getFullYear()+"-"+this.zreo(date.getMonth() + 1)+"-"+this.zreo(date.getDate())
					// 当前时间时间戳
					// let dqTime=date.valueOf("time")
					// res.giftInformationList.pageList.forEach(v=>{
					// 	if(new Date(v.receiveEndTime).valueOf()>=dqTime){
					// 		v.chage=1
					// 	}else{
					// 		v.chage=2
					// 	}
					// })
					// 判断当前月份有没有被领取过礼品
					// res.giftInformationList.pageList.forEach(v=>{
					// 	if(v.whetherReceive>0){
					// 		this.mothChage = true
					// 	}
					// })
					this.downStatus = false
					res.giftInformationList.pageList.map((item)=>{
						item.whetherAdvance = this.months==1?item.whetherAdvance:this.months==3?1:0
						item.whetherOverdue = this.months==1?item.whetherOverdue:this.months==2?1:0
						item.showNum=item.giftType!='2'
					})
					
					numToSort={}
					var newArr = res.giftInformationList.pageList.filter(item=>{
						return !item.batch
					}).map(item=>{
						if(this.licensePlateList.length == 0 && item.giftType == 2) {
							return {
								...item,
								sortIndex:{index:0}
							}
						} else {
							return {
								...item,
								sortIndex:{index:0}
							}
						}
						
					})
					var tempArr1=[]
					var tempArr2 = res.giftInformationList.pageList.filter(item=>{
						return item.batch
					})
					tempArr2.map(item=>{
						item.batch = item.batch||1
					})
					// .sort(function(a,b){
					// 	return a.batch-b.batch
					// })
					
					tempArr2.map((item,index)=>{
						// console.log(tempArr1);
						let temp = tempArr1.filter(item2=>item2.batch==item.batch&&item2.giftType==item.giftType&&item2.navTitle)
						if(temp.length>0){
							
							temp[0].num=temp[0].num+1
							temp[0].navTitle=this.multipleForOneText(temp[0].num)+'选一专区'
							temp[0].sortIndex=numToSort[`type${item.giftType}batch${item.batch}`]
							item.isDisabled=!!tempArr2.filter(item2=>item2.batch==item.batch&&item2.whetherReceive==1).length,
							item.sortIndex=numToSort[`type${item.giftType}batch${item.batch}`]
							numToSort[`type${item.giftType}batch${item.batch}`].index = temp[0].num
							tempArr1.push(item)
							
						}else{
							numToSort[`type${item.giftType}batch${item.batch}`]={index:1}
							tempArr1.push({
								navTitle:this.multipleForOneText(1)+'选一专区',
								batch:item.batch,
								giftType: item.giftType,
								whetherReceive:tempArr2.filter(item2=>item2.batch==item.batch&&item2.whetherReceive==1).length,
								whetherAdvance:this.months==1?tempArr2.filter(item2=>item2.batch==item.batch).every(item=>item.whetherAdvance==1)?1:0:this.months==3?1:0,
								whetherOverdue:this.months==1?tempArr2.filter(item2=>item2.batch==item.batch).every(item=>item.whetherOverdue==1)?1:0:this.months==2?1:0,
								id:count+index,
								num:1,
								sortIndex:numToSort[`type${item.giftType}batch${item.batch}`]
							})
							item.isDisabled=!!tempArr2.filter(item2=>item2.batch==item.batch&&item2.whetherReceive==1).length,
							item.sortIndex=numToSort[`type${item.giftType}batch${item.batch}`]
							tempArr1.push(item)
						}
						
						// console.log(tempArr1);
						// console.log(JSON.stringify(numToSort,null,2))
						
					})
					
					// console.log('numToSort',numToSort)
					this.giftList = [...newArr,...tempArr1]
					if (this.licensePlateList.length == 0) {
						this.giftList = this.giftList.filter(el => {
							return el.giftType != 2
						})
					}
					this.giftList.sort(function(a,b){
						return a.sortIndex.index-b.sortIndex.index
					})
					uni.hideLoading();
					// console.log(JSON.stringify(this.giftList,null,2))
					
					// tempArr2.map((item,index)=>{
					// 	if(item.batch!=1&&newArr.filter(item2=>item2.batch==item.batch).length){
					// 		newArr.push(item)
					// 	}else{
					// 		newArr.push({
					// 			navTitle:this.multipleForOneText(item.batch)+'选一专区',
					// 			batch:item.batch,
					// 			whetherReceive:0,
					// 			id:count+index,
					// 			num:0
					// 		})
							
					// 	}
					// })
					
					
					
					
					
					// console.log('newArr',newArr)
					// bug修改  2023-07-06 请求列表后 第一个是旧数据，mothChage改为true没得到重置
					// this.mothChage = this.giftList.some(v => v.whetherReceive > 0);

					
				}).catch(() => {
					uni.hideLoading();
				})
			},
			// 新改
			// gift(index){
			// 	let that = this;
			// 	this.$myRequest
				
			// 		// .get("/api/mobile/vehicleOwner/getDropDownListGiftInformation", {
			// 		.get("/api/mobile/vehicleOwner/getAllGiftLists", {
			// 			merchantId: this.userInfo.merchantId,
			// 			type: this.merchantValue - 1,
			// 			pageNo:1,
			// 			pageSize:99,
			// 		}).then(res => {
			// 			this.giftList = res.GiftLists.pageList;
			// 		});
			// },
			// 补零
			zreo(time) {
				if (time > 10) {
					return time
				} else {
					return '0' + time
				}
			},
			lpdetails(item) {
				
				
				var isX = item.giftType=="2"?1:''
				var isDisabled = item.isDisabled?2:1
				if (item.whetherReceive) { 
					// if(item.batch){
					// 	item.whetherReceive = this.giftList.filter(item2=>item2.batch==item.batch&&item2.whetherReceive).length>0?'1':''
					// }
					uni.navigateTo({
						url: "/pages_owner/carMember/giftDetails?id=" + item.id + "&whetherReceive=" + item
							.whetherReceive + "&mothChage=" + this.mothChage + "&months=" + this.months +'&license='+this.license + '&whetherOverdue='+item.whetherOverdue+ '&whetherAdvance='+item.whetherAdvance + '&isX='+isX+'&isDisabled='+isDisabled + '&isCanRecord='+item.isCanRecord
					})
				} else {
					uni.navigateTo({
						url: "/pages_owner/carMember/giftDetails?id=" + item.id + "&mothChage=" + this.mothChage + "&months=" + this.months+'&license='+this.license + '&whetherOverdue='+item.whetherOverdue+ '&whetherAdvance='+item.whetherAdvance+ '&isX='+isX+'&isDisabled='+isDisabled + '&isCanRecord='+item.isCanRecord
					})
				}
			},
			cutClik(index) {
				this.cut = index
				numToSort={} 
				this.gift(index)
			},
			qulq(item, index) {
				if (item.isCanRecord == 0) {
					return
				}
				if (index == 1) {
					if (item.isDisabled) {
						uni.showToast({
							title: "该车辆本月已领取会员礼!",
							icon: "none",
							mask: true,
						});
						return
					}
					if (!item.stock) {
						this.qiehuan = 1
						this.$refs.binds.open()
						return
					}
					
				}
				// else {
				// 	this.curItem=item
				// 	this.qiehuan = 2
				// 	this.$refs.binds.open()
				// 	return
				// }
				// if(item.batch){
				// 	// var id = this.giftList.filter(item2=>item2.batch==item.batch&&!item2.navTitle).map(item=>item.id).join(',')
				// 	var id = this.giftList.filter(item2=>item2.batch==item.batch&&!item2.navTitle).map(item=>item.id)[0]
				// 	var giftName = this.giftList.filter(item2=>item2.batch==item.batch&&!item2.navTitle).map(item=>item.giftName)[0] 
				// 	uni.navigateTo({
				// 		url: "/pages_owner/carMember/merchantList?id=" + id +'&license='+this.license+ "&giftName=" + (this.giftList.filter(item2=>item2.batch==item.batch&&!item2.navTitle).length==1?giftName:'')
				// 	})
				// 	return
				// }else{
				// 	var id = item.id
				// 	var giftName = item.giftName
				// }
				var id = item.id
				var giftName = item.giftName
				let giftType = item.giftType
				uni.navigateTo({
					url: "/pages_owner/carMember/merchantList?id=" + id +'&license='+this.license+ "&giftType="+giftType+ "&giftName=" + giftName
				})
			},
			toTranslate() {
				// if(this.curItem.batch){
				// 	// var id = this.giftList.filter(item2=>item2.batch==this.curItem.batch&&!item2.navTitle).map(item=>item.id).join(',')
				// 	var id = this.giftList.filter(item2=>item2.batch==this.curItem.batch&&!item2.navTitle).map(item=>item.id)[0]
				// var giftName = this.giftList.filter(item2=>item2.batch==this.curItem.batch&&!item2.navTitle).map(item=>item.giftName)[0] 
				// uni.navigateTo({
				// 	url: "/pages_owner/carMember/merchantList?id=" +id +'&license='+this.license+ "&giftName=" + (this.giftList.filter(item2=>item2.batch==this.curItem.batch&&!item2.navTitle).length==1?giftName:'')
				// })
				// return
				// }else{
				// 	var id = this.curItem.id
				// 	var giftName = this.curItem.giftName
				// }
				
				this.$refs.binds.close()
				var id = this.curItem.id
				var giftName = this.curItem.giftName
				let giftType = this.curItem.giftType
				uni.navigateTo({ 
					url: "/pages_owner/carMember/merchantList?id=" +id +'&license='+this.license+ "&giftName=" + giftName+ "&giftType="+giftType
				})
			},
			tcGuanBi() {
				this.$refs.binds.close()
			},
			jinzhi() {
				let _this = this;
				let param = window.location.href.split("#")[0];
				uni.request({
					method: "post",
					data: {
						url: param
					},
					header: {
						"content-type": "application/x-www-form-urlencoded"
					},
					url: "https://www.bangbangtongcheng.com/conven//mob/login/getJsTicket.do",
					success(re) {
						_this.jinzhifx(re.data);
					}
				});
			},
			jinzhifx(data) {
				wxshare.config({
					debug: false, //是否打开调试
					appId: data.appId, // 公众号的唯一标识
					timestamp: data.timestamp, // 生成签名的时间戳
					nonceStr: data.nonce, // ，生成签名的随机串
					signature: data.signature, // 签名
					jsApiList: ["hideMenuItems"]
				});
				// 禁止分享
				wxshare.hideMenuItems({
					// 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
					menuList: [
						"menuItem:share:appMessage",
						"menuItem:share:timeline",
						"menuItem:share:timeline",
						"menuItem:share:qq",
						"menuItem:favorite",
						"menuItem:share:QZone",
						"menuItem:openWithSafari"
					]
				});
			},
			fanhui() {
				uni.navigateBack({
					delta: 1
				});
			},
		}
	};
</script>

<style lang="less" scoped>
	page {
		background-color: #fff;
	}

	.box {
		width: 100%;
		background-color: #fff;
	}

	.binds_frame {
		width: 600rpx;
		// height: 286rpx;
		padding-bottom: 50rpx;
		background-color: #FFFFFF;
		border-radius: 10rpx;
		text-align: center;
		position: relative;

		.binds_frame_t {
			font-size: 30rpx;
			font-weight: 550;
			color: #000000;
			padding: 0 46rpx;
			padding-top: 36rpx;
		}

		.binds_frame_b {
			width: 480rpx;
			height: 70rpx;
			margin: 0 auto;
			margin-top: 30rpx;
			background-color: #64B6A8;
			border-radius: 10rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 30rpx;
			font-weight: 400;
			color: #FFFFFF;
		}
	}

	.tou {
		position: relative;
		width: 100%;
		// height: 88rpx;
		text-align: center;
		/* #ifdef MP-WEIXIN */
		text-align: left;
		display: flex;
		align-items: center;
		/* #endif */
		line-height: 88rpx;
		font-size: 36rpx;
		color: #fff;
		background-color: #64b6a8;

		.image1 {
			position: absolute;
			width: 32rpx;
			height: 32rpx;
			// top: 116rpx;
			left: 30rpx;
		}

		.image2 {
			position: absolute;
			width: 56rpx;
			height: 56rpx;
			bottom: 16rpx !important;
			// top: 116rpx;
			right: 30rpx;
			/* #ifdef MP-WEIXIN */
			position: initial;
			margin-left: auto;
			margin-right: 200rpx;
			/* #endif */
		}
	}

	.tit {
		width: 750rpx;
		height: 100rpx;
		background-color: #f4f4f4;
		display: flex;
		align-items: center;
		justify-content: space-around;
		font-size: 30rpx;
		font-weight: 400;
		color: #999999;

		.tit_item {
			display: flex;
			flex-direction: column;
			align-items: center;

			.image {
				width: 60rpx;
				height: 30rpx;
			}
		}

		.xuan {
			font-size: 36rpx;
			font-weight: 400;
			color: #64B6A8;
		}
	}

	.scroll-view {
		// #ifdef MP-WEIXIN
		height: calc(100vh - var(--status-bar-height) - 5px - 88px - 120rpx);
		// #endif
		// #ifdef H5 || APP-PLUS
		height: calc(100vh - var(--status-bar-height) - 5px - 88rpx - 120rpx);
		// #endif
	}

	.scroll-views {
		// #ifdef MP-WEIXIN
		height: calc(100vh - var(--status-bar-height) - 5px - 88px);
		// #endif
		// #ifdef H5 || APP-PLUS
		height: calc(100vh - var(--status-bar-height) - 5px - 88rpx);
		// #endif
	}

	.classify_top {
		height: 115rpx;
		display: flex;
		align-items: center;
		box-shadow: 0px 1px 6px 1px rgba(0, 0, 0, 0.1);

		.left {
			width: 180rpx;
			text-align: center;
		}

		.right {
			width: 570rpx;
			text-align: center;
		}
	}

	.classify {
		display: flex;

		.classify-left {
			width: 180rpx;
			background: #f4f4f4;

			.iteam {
				vertical-align: top;
				width: 100%;
				height: 110rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				position: relative;
				.nums{
					width: 40rpx;
					height: 40rpx;
					background: #EA4B4B;
					border-radius: 8rpx 0px 0px 8rpx;
					opacity: 1;
					display: flex;
					align-items: center;
					justify-content: center;
					padding: 0 10rpx;
					position: absolute;
					right: 0;
					top: 0;
					color: #fff;
					font-size: 22rpx;
				}
			}
		}

		.classify-right {
			box-sizing: border-box;
			width: 570rpx;
			background-color: #fff;
			padding: 40rpx 0;

			.productList {
				display: flex;
				flex-direction: column;
				justify-content: center;
				padding: 0 30rpx;

				.iteam {
					display: flex;
					flex-direction: column;
					margin-bottom: 20rpx;

					.iteam_top {
						display: flex;

						.iteam_image {
							width: 140rpx;
							height: 124rpx;
							border-radius: 6rpx;
						}

						.iteam_images {
							width: 218rpx;
							height: 156rpx;
							border-radius: 6rpx;
						}

						.iteam_right {
							flex: 1;
							margin-left: 16rpx;
							display: flex;
							flex-direction: column;
							justify-content: space-between;

							.title {
								font-size: 28rpx;
								font-weight: 550;
								color: #333333;
								overflow: hidden;
								text-overflow: ellipsis;
								display: -webkit-box;
								-webkit-line-clamp: 1; //想要的行数
								-webkit-box-orient: vertical;
							}

							.titles {
								width: 300rpx;
								font-size: 28rpx;
								font-weight: 550;
								color: #333333;
								overflow: hidden;
								text-overflow: ellipsis;
								display: -webkit-box;
								-webkit-line-clamp: 1; //想要的行数
								-webkit-box-orient: vertical;
							}

							.fenshu {
								display: flex;
								align-items: flex-end;
								justify-content: space-between;
								.price{
									font-size: 30rpx;
									color: red;
									display: flex;
									align-items: center;
									.price1 {
										margin-right: 12rpx;
										color: #666;
										font-size: 24rpx;
										text-decoration: line-through;
									}
								}
								.fenshu_s {
									font-size: 26rpx;
									font-weight: 500;
									color: #333333;
									text-align: center;
								}

								.fenshu_l {
									width: 150rpx;
									height: 60rpx;
									background-color: #64B6A8;
									border-radius: 26rpx;
									font-size: 26rpx;
									font-weight: 400;
									color: #FFFFFF;
									display: flex;
									align-items: center;
									justify-content: center;
								}
								.fail{
									background: #999999;
								}
							}
						}
					}

					.iteam_time {
						font-size: 24rpx;
						font-weight: 400;
						color: #999999;
					}
				}
				.date{
					color: #999999;
					font-size: 26rpx;
					margin-bottom: 20rpx;
				}
			}

			.record {
				padding: 0 30rpx;

				.choice {
					display: flex;
					align-items: center;
					margin-bottom: 30rpx;

					.choice_time {
						width: 300rpx;
						margin-right: 30rpx;
					}

					.choice_xz {
						flex: 1;
					}
				}

				.iteam {
					margin-bottom: 30rpx;
					width: 510rpx;
					height: 270rpx;
					background-color: #FFFFFF;
					box-shadow: 0px 1px 6rpx 1px rgba(0, 0, 0, 0.16);
					border-radius: 12rpx;
					padding: 24rpx 34rpx;

					.iteam_s {
						display: flex;
						align-items: center;
						font-size: 24rpx;
						font-weight: 400;
						color: #999999;
						margin-bottom: 16rpx;

						.iteam_span {
							color: #333333;
							width: 90rpx;
							text-align-last: justify;
						}
					}
				}
			}
		}
	}

	.Employee {
		padding: 0 30rpx;
		padding-top: 32rpx;

		.Employee_tab {
			width: 690rpx;
			height: 80rpx;
			border-radius: 12rpx;
			border: 1px solid #C7C7C7;
			display: flex;
			align-items: center;
			margin-bottom: 20rpx;

			.name {
				flex: 1;
				font-size: 32rpx;
				font-weight: 550;
				color: #333333;
				text-align: center;
			}

			.phone {
				flex: 1;
				font-size: 32rpx;
				font-weight: 550;
				color: #333333;
				text-align: center;
			}
		}

		.iteam {
			width: 690rpx;
			height: 85rpx;
			border-bottom: 1px solid #C7C7C7;
			display: flex;
			align-items: center;

			.iteam_span {
				flex: 1;
				font-size: 28rpx;
				font-weight: 400;
				color: #333333;
				text-align: center;
			}
		}

		.newlyAdded {
			position: fixed;
			left: 50%;
			bottom: 100rpx;
			transform: translateX(-50%);
			width: 670rpx;
			height: 84rpx;
			background-color: #64B6A8;
			border-radius: 8rpx;
			display: flex;
			align-items: center;
			justify-content: center;

			.image {
				width: 28rpx;
				height: 28rpx;
				margin-right: 20rpx;
			}

			.xz {
				font-size: 34rpx;
				font-weight: 400;
				color: #FFFFFF;
			}
		}
	}
	.none {
		text-align: center;
	
		image {
			width: 430rpx;
			margin-bottom: 16rpx;
		}
	
		view {
			height: 40rpx;
			line-height: 40rpx;
			color: #666;
			margin-bottom: 24rpx;
		}
	}
		.more {
			width: 100%;
			text-align: center;
			font-size: 26rpx;
			font-weight: 400;
			color: #8FBAB2;
			margin: 20rpx 0;
		}
</style>